# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Bence Balint <balintbence1337@gmail.com>

pkgname=python-w3lib
pkgver=2.1.2
pkgrel=1
pkgdesc="Library of web-related functions"
arch=('any')
license=('BSD')
url="https://github.com/scrapy/w3lib"
depends=('python')
makedepends=('python-setuptools')
checkdepends=('python-pytest')
source=("$pkgname-$pkgver.tar.gz::https://github.com/scrapy/w3lib/archive/v$pkgver.tar.gz")
sha512sums=('ed951a78233065e70b45d52401be14723e92a69ce34756afa74fc0a75f170239f69dfd35d1819b91eeaea74d6748f7893b303cc9d321a6b6dae6cd8a672353e9')

build() {
  cd w3lib-$pkgver
  python setup.py build
}

check() {
  cd w3lib-$pkgver
  pytest
}

package() {
  cd w3lib-$pkgver
  python setup.py install --root="$pkgdir" --optimize=1
  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
}
